package com.ling.sdk.utils

import android.content.Context
import com.orhanobut.hawk.Hawk

/**
 * Created by MinF on 2017/11/20 0020.
 */
object Cache {


    fun init(app: Context) {
        HawkJava.init(app)

    }

    @JvmStatic
    fun <T> put(key: String, t: T) = Hawk.put(key, t)

    @JvmStatic
    fun remove(key: String) = Hawk.delete(key)

    @JvmStatic
    fun <T> get(key: String):T? = Hawk.get<T>(key)

    @JvmStatic
    fun <T> get(key: String, t: T):T = Hawk.get<T>(key, t)
/*

    @JvmStatic
    fun <T> put(key: String, t: T) = ACache.get().put(key, t as Serializable)

    @JvmStatic
    fun remove(key: String) = ACache.get().remove(key)

    @JvmStatic
    fun <T> get(key: String) = ACache.get().getAsObject(key) as T?

    @JvmStatic
    fun <T> get(key: String, t: T) = (ACache.get().getAsObject(key) as? T) ?: t
*/


}